<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<title>生产地址增加</title>
</head>

<body>

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>生产地址增加列表</legend>
	</fieldset>

	<form class="layui-form" action="../../../pre/add.action"
		method="post" id="myform">
		<input type="hidden" id="preId" name="preId">
		<div class="layui-form-item">
			<label class="layui-form-label">地址名称</label>
			<div class="layui-input-block">
				<input type="text" name="preSite" id="preSite"
					lay-verify="required" placeholder="请输入" autocomplete="off"
					class="layui-input" maxlength="10">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">邮政编码</label>
			<div class="layui-input-block">
				<input type="text" name="prePostal" id="prePostal"
					lay-verify="required" placeholder="请输入" autocomplete="off"
					class="layui-input" maxlength="10">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">联系电话</label>
			<div class="layui-input-block">
				<input type="text" name="prePhone" id="prePhone" onblur="phone()"
					lay-verify="required" placeholder="请输入" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<!-- 提交重置 -->
		<div class="layui-form-item">
			<div class="layui-input-block">
				<input  type="submit" class="layui-btn" lay-submit=""
				lay-filter="preAdd" value="立即提交">
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>

	<script src="../../../layui/layui.js"></script>
	<script type="text/javascript" src="../../../res/wzw/js/jquery.min.1.6.4.js"></script>
	<script src="../../../res/wzw/js/jquery-1.10.2.js"></script>

	<script>
	
	//手机验证
	function phone(){
	    var phone = document.getElementById('prePhone').value;
	    if(!(/^1[34578]\d{9}$/.test(phone))){
	       /* alert("手机号码有误，请重新填写"); */
	       $("#prePhone").attr("placeholder","手机号码格式不正确");
	       document.getElementById('prePhone').value="";
	       return false;
	    }
	}
	
	layui.use(['form', 'layer','laydate'], function(){
	  var form = layui.form
	  ,layer = layui.layer
	  ,laydate = layui.laydate
	  ,$ = layui.$;
	 
	  form.on('submit(preAdd)',function(){
		  parent.location.reload(); // 父页面刷新
	  }); 
	});
</script>

</body>
</html>